<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位</title>
    <style>
        .box1{
            width: 100px;
            height: 100px;
            background-color: gold;
            border: 1px;
            border-radius:10px;
            position: absolute;
        }
        .box2{
            width: 28px;
            height: 28px;
            background-color: red;
            border: 1px;
            border-radius: 50%;
            position: relative;
            left: 84px;
            top: -7px;
        }
        .box2 p{
            text-align: center;
            line-height: 28px;
            color: white;
        }
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2">
        <p>5</p>
    </div>
</body>
</html>